package com.work.mb;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.logging.Logger;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import com.work.facade.ProjectFacade;
import com.work.model.Project;
import com.work.model.User;

/**
 * The Class ProjectMB.
 *
 * @author "Mihai Roman"
 */
@ManagedBean(name = "projectMB")
@SessionScoped
public class ProjectMB implements Serializable {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -1490172558088401477L;
	
	private final static Logger LOG = Logger.getLogger(ProjectMB.class.getName()); 
	
	@EJB
	private ProjectFacade projectFacade;
	
	/** The code freeze . */
	private Date codeFreeze;
	
	/** The created date . */
	private Date createdDate;
	
	/** The domain . */
	private String domain;
	
	/** The end date . */
	private Date endDate;
	
	/** The name . */
	private String name;
	
	/** The start date . */
	private Date startDate;
	
	/** The updated date . */
	private Date updatedDate;
	
	/** The user pm . */
	private User userPM;
	
	/** The user created by . */
	private User userCreatedBy;
	
	/**
	 * @return the projectFacade
	 */
	public ProjectFacade getProjectFacade() {
		return projectFacade;
	}

	/**
	 * @param projectFacade the projectFacade to set
	 */
	public void setProjectFacade(ProjectFacade projectFacade) {
		this.projectFacade = projectFacade;
	}

	/**
	 * @return the domain
	 */
	public String getDomain() {
		return domain;
	}

	/**
	 * @param domain the domain to set
	 */
	public void setDomain(String domain) {
		this.domain = domain;
	}

	/**
	 * @return the endDate
	 */
	public Date getEndDate() {
		return endDate;
	}

	/**
	 * @param endDate the endDate to set
	 */
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the startDate
	 */
	public Date getStartDate() {
		return startDate;
	}

	/**
	 * @param startDate the startDate to set
	 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	/**
	 * @return the updatedDate
	 */
	public Date getUpdatedDate() {
		return updatedDate;
	}

	/**
	 * @param updatedDate the updatedDate to set
	 */
	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	/**
	 * @return the userPM
	 */
	public User getUserPM() {
		return userPM;
	}

	/**
	 * @param userPM the userPM to set
	 */
	public void setUserPM(User userPM) {
		this.userPM = userPM;
	}

	/**
	 * @return the userCreatedBy
	 */
	public User getUserCreatedBy() {
		return userCreatedBy;
	}

	/**
	 * @param userCreatedBy the userCreatedBy to set
	 */
	public void setUserCreatedBy(User userCreatedBy) {
		this.userCreatedBy = userCreatedBy;
	}

	public List<Project> findAllProjects() {
		return projectFacade.findAll();
	}

	/**
	 * @return the codeFreeze
	 */
	public Date getCodeFreeze() {
		return codeFreeze;
	}

	/**
	 * @param codeFreeze the codeFreeze to set
	 */
	public void setCodeFreeze(Date codeFreeze) {
		this.codeFreeze = codeFreeze;
	}

	/**
	 * @return the createdDate
	 */
	public Date getCreatedDate() {
		return createdDate;
	}

	/**
	 * @param createdDate the createdDate to set
	 */
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

}
